function quesOrderDetailsDialog(orderId) {
    if (!orderId) {
        return $.toast("订单ID不能为空");
    }

    const orderStateDict = {"1": "待支付", "2": "已支付", "3": "已完成", "-1": "支付超时", "-2": "取消"}

    getQuesOrderDetails({orderId}, ({Code, Message, Result}) => {
        if (Code !== 10000) {
            return $.toast(Message);
        }

        const {questionTitle, price, addTime, payTime,cancelTime, cancelRemark, orderState, answer = []} = Result;

        const $widget = $(`
            <div style="max-height: 500px;padding:0;overflow: auto;overflow-x:hidden">
                <div class="row mb20">
                    <div class="col-xs-6">
                        <span class="col-xs-4">订单ID：</span>
                        <span class="col-xs-8">${orderId}</span>
                    </div>
                    <div class="col-xs-6">
                        <span class="col-xs-4">订单金额：</span>
                        <span class="col-xs-8">${(price / 100).toFixed(2)}</span>
                    </div>
                </div>
                <div class="row mb20">
                    <div class="col-xs-6">
                        <span class="col-xs-4">问卷标题：</span>
                        <span class="col-xs-8">${questionTitle || ""}</span>
                    </div>
                    <div class="col-xs-6">
                        <span class="col-xs-4">提交时间：</span>
                        <span class="col-xs-8">${addTime || ""}</span>
                    </div>
                </div>
                <div class="row mb20">
                    <div class="col-xs-6">
                        <span class="col-xs-4">订单状态：</span>
                        <span class="col-xs-8">${orderStateDict[orderState]}</span>
                    </div>
                    ${orderState === -2 ? `
                        <div class="col-xs-6">
                            <span class="col-xs-4">取消备注：</span>
                            <span class="col-xs-8">${cancelRemark || ""}</span>
                        </div>
                    ` : ''}
                    
                    ${orderState === 2 ? `
                        <div class="col-xs-6">
                            <span class="col-xs-4">支付时间：</span>
                            <span class="col-xs-8">${payTime || ""}</span>
                        </div>
                    ` : ''}
                </div>
                
               
            </div>
        `);

        if (answer && answer.length){
            $widget.append(`
                <div class="row mb20">
                    <hr/>
                </div>
            `);
        }

        answer.forEach(({rowTitle, rowValue, rowType}) => {
            let $dom;
            if (rowType === 5) {
                $dom = $(`
                    <div class="row mb20">
                        <div class="col-xs-12">
                            <span class="col-xs-2">${rowTitle}：</span>
                            <span class="col-xs-10">
                                <ul data-wrap="img" class="eval-img-ul" style="position: unset !important;"></ul>
                            </span>
                        </div>
                    </div>
                `)

                const $cont = $dom.find('[data-wrap="img"]');
                rowValue.split(",").forEach(url => {
                    const $card = $(`
                        <li>
                            <a data-lightbox="example-set" href="${url}">
                                <img src="${url}" alt="">
                            </a>
                        </li>
                    `);

                    $cont.append($card);
                });
            } else {
                $dom = $(`
                    <div class="row mb20">
                        <div class="col-xs-12">
                            <span class="col-xs-2">${rowTitle}：</span>
                            <span class="col-xs-10">${rowValue || "-"}</span>
                        </div>
                    </div>
                `)
            }

            $widget.append($dom);
        })

        const $dialogWidget = $.dialog($widget, {
            title: "订单明细",
            width: "700px",
            cancel: null,
            ok: null
        })
    })

    function getQuesOrderDetails(param, callback = Function()) {
        return $.sApi({
            data: param,
            url: "/api/QuestionOrder/getQuesOrderDetails"
        }, callback)
    }
}